/**
 * @Created by pangzg pangzg2@yusys.com.cn on 2020-3-31 14:22:49.
 * @updated by
 * @description 任务列表清单
 */
define(['./pages/use/monitors/taskMonitor/taskMonitorList/taskMonitorList.css'], function (require, exports) {
  /**
   * 页面加载完成时触发
   * @param hashCode 路由ID
   * @param data 传递数据对象
   * @param cite 页面站点信息
   */
  exports.ready = function (hashCode, data, cite) {
    yufp.lookup.reg('USE_JOB_RUN_STATE,USE_TASK_RUN_STATE,USE_EVT_REL_TYPE,USE_TASK_JOB_TYPE');
    yufp.custom.vue({
      el: cite.el,
      data: function () {
        var _this = this;
        return {
          title: data.title,
          queryJobRef: {},
          dataUrl: 'api/use/monitor/taskMonitor/queryJobList',
          queryFields: [{
            label: '作业代码',
            placeholder: '作业代码',
            field: 'actionCode',
            type: 'input'
          }, {
            label: '作业名称',
            placeholder: '作业名称',
            field: 'actionName',
            type: 'input'
          },
          {
            label: '状态',
            placeholder: '作业状态',
            field: 'jobState',
            type: 'select',
            options: [{
              key: 'F',
              value: '失败'
            },
            {
              key: 'Q',
              value: '队列中'
            },
            {
              key: 'S',
              value: '成功'
            },
            {
              key: 'U',
              value: '未知'
            },
            {
              key: 'X',
              value: '执行中'
            },
            {
              key: 'W',
              value: '等待'
            },
            {
              key: 'N',
              value: '未执行'
            },
            {
              key: 'C',
              value: '当前'
            }
            ]
          },
          ],
          queryButtons: [{
            label: '搜索',
            op: 'submit',
            type: 'primary',
            click: function (model, valid) {
              var param = {
                condition: {
                  coreId: data.isHistory ? data.wftId : data.coreId,
                  cycleNo: data.cycleNo,
                  actionName: model.actionName,
                  actionCode: model.actionCode,
                  jobState: (model.jobState && model.jobState != '') ? model.jobState : null
                }
              };
              _this.$refs.refTable.remoteData(param);
            }
          },
          {
            label: '重置',
            op: 'reset'
          }
          ],
          wftParList: [],
          refLogFormData: {},
          useEventLogList: [],
          logText: '',
          baseFormData: {},
          tabsActiveName: '0',
          visible: false,
          jobStateObj: {
            'F': '失败',
            'Q': '队列中',
            'S': '成功',
            'U': '未知',
            'X': '执行中',
            'N': '未执行',
            'W': '等待',
            'E': '失败',
            'I': '被中断',
            'C': '已崩溃',
            'O': '完成'
          },
          //作业状态
          jobStateOptions: [{
            key: 'F',
            value: '失败'
          },
          {
            key: 'Q',
            value: '队列中'
          },
          {
            key: 'S',
            value: '成功'
          },
          {
            key: 'U',
            value: '未知'
          },
          {
            key: 'X',
            value: '执行中'
          },
          {
            key: 'W',
            value: '等待'
          },
          {
            key: 'N',
            value: '未执行'
          }],
          buttonShow: true,
          historyRunState: false,
          agentIds: [],
          queryJobModel: {},
          preValueFormdata: {}, //预置返回值表单对象
          preValueDialogVisible: false, //预置返回值是否显示
          showModifyRetValue: false,
          modifyRetValue: {}, // 修改返回值
          loadDataCount: 0,
          loadData: [], //处理过程展示
          showDialog: false, //处理过程进度页面控制
          //按钮权限
          redoBnt: data.redoBnt,
          interruptBnt: data.interruptBnt,
          forceSuccessBnt: data.forceSuccessBnt,
          preValueBnt: data.preValueBnt,
          unPreValueBnt: data.unPreValueBnt,
          forceJobValueBnt: data.forceJobValueBnt,
          jobParamBnt: data.jobParamBnt,
          jobPriorBnt: data.jobPriorBnt,
          //详情页面修改控制
          updateFlag: false,
          jobPriorValue: {},
          showJobPriorValue: false,
          loading: false,
          isHistory: data.isHistory,
          //排序字段映射
					sortColunms: {
						'enterTimeStr': 'ENTER_TIME',
						'beginTimeStr': 'BEGIN_TIME'
					},
					//排序方式映射
					sortTypes: {
						'descending': 'desc',
						'ascending': 'asc'
					}
        };
      },
      created() {
        var _this = this;
        _this.queryWftAgtList();
      },
      mounted() {
        var _this = this;
        var param = {
          condition: {
            coreId: data.coreId,
            cycleNo: data.cycleNo,
            jobState: data.searchState
          }
        };
        _this.buttonShow = true;
        if (data.isHistory) {
          _this.dataUrl = 'api/use/monitor/taskMonitorHis/queryJobList';//变更url将发起查询
          param.condition.coreId = data.wftId;
          _this.historyRunState = true;
          _this.buttonShow = false;
        }
        _this.$refs.refTable.remoteData(param);
        _this.$nextTick(function () {
          _this.$refs.queryJobRef.fm.jobState = data.searchState;
        });
      },
      methods: {
        /**
         * 查看作业详细信息 
         */
        showJobInfo: function (row) {
          // 重新打开节点页面
          var _this = this;
          _this.tabsActiveName = '0';
          _this.updateFlag = false;
          _this.loading = true;
          if (row == null) {
            return;
          }
          var requestUrl = (data.isHistory) ? '/monitor/taskMonitorHis/queryFlowJobDetail' :
            '/monitor/taskMonitor/flowJobDetail'
          // 弹窗
          _this.visible = true;
          yufp.service.request({
            url: backend.useService + requestUrl,
            method: 'get',
            data: {
              coreId: row.coreId,
              sequence: row.sequence,
              cycleNo: row.cycleNo,
              actionCode: row.actionCode,
              groupCode: row.groupCode,
              appCode: row.appCode,
              cycleTime: row.cyclePnt
            },
            callback: function (code, message, response) {
              if (response && response.data) {
                _this.$nextTick(function () {
                  _this.$refs.refBaseForm.resetFields();
                  var jobState = response.data.jobState;
                  _this.wftParList.splice(0);
                  _this.useEventLogList.splice(0);
                  _this.logText = '';
                  yufp.clone(response.data, _this.baseFormData);
                  _this.baseFormData.jobStateStr = jobState in _this.jobStateObj ? _this.jobStateObj[jobState] : jobState;
                  _this.logText = response.data.logText;
                  _this.wftParList = yufp.clone(response.data.wftParList, []);
                  _this.useEventLogList = yufp.clone(response.data.useEventLogList, []);
                });
              } else {
                _this.$message({
                  message: response.message,
                  type: 'warning', duration: 6000
                });
              }
              _this.loading = false;
            }
          });
        },
        // 详情处理方法
        jobParamInfo: function (paramUrl) {
          var _this = this;
          var selectionsAry = _this.$refs.refTable.selections;
          if (selectionsAry.length != 1) {
            _this.$message({
              message: '请先选择一条记录',
              type: 'warning', duration: 6000
            });
            return;
          }
          _this.tabsActiveName = '0';
          // 弹窗
          _this.visible = true;
          _this.loading = true;
          yufp.service.request({
            url: backend.useService + paramUrl,
            method: 'get',
            data: {
              coreId: selectionsAry[0].coreId,
              sequence: selectionsAry[0].sequence,
              cycleNo: selectionsAry[0].cycleNo,
              actionCode: selectionsAry[0].actionCode,
              groupCode: selectionsAry[0].groupCode,
              appCode: selectionsAry[0].appCode,
              updateFlag: _this.updateFlag,
              repeatNo: selectionsAry[0].repeatNo != null ? selectionsAry[0].repeatNo : 0,
              cycleTime: selectionsAry[0].cyclePnt
            },
            callback: function (code, message, response) {
              if (response && response.data) {
                _this.$nextTick(function () {
                  _this.$refs.refBaseForm.resetFields();
                  var jobState = response.data.jobState;
                  _this.wftParList.splice(0);
                  _this.useEventLogList.splice(0);
                  _this.logText = '';
                  yufp.clone(response.data, _this.baseFormData);
                  _this.baseFormData.jobStateStr = jobState in _this.jobStateObj ? _this.jobStateObj[jobState] : jobState;
                  _this.logText = response.data.logText;
                  _this.wftParList = yufp.clone(response.data.wftParList, []);
                  _this.useEventLogList = yufp.clone(response.data.useEventLogList, []);
                });
              } else {
                _this.$message({
                  message: response.message,
                  type: 'warning', duration: 6000
                });
              }
              _this.loading = false;
            }
          });
        },
        // 详情
        infoFn: function () {
          var _this = this;
          _this.updateFlag = false;
          var requestUrl = (data.isHistory) ? '/monitor/taskMonitorHis/queryFlowJobDetail' : '/monitor/taskMonitor/flowJobDetail';
          _this.jobParamInfo(requestUrl);
        },
        // 作业信息修改
        jobParamClick: function () {
          var _this = this;
          _this.updateFlag = true;
          _this.jobParamInfo("/monitor/taskMonitor/flowJobDetail");
        },
        // 作业信息修改保存
        jobParamSave: function () {
          var _this = this;
          if (_this.baseFormData.actionPrior >= 0 && _this.baseFormData.actionPrior <= 9 && _this.baseFormData.actionPrior % 1 === 0) {
            _this.loading = true;
            yufp.service.request({
              url: 'api/use/monitor/taskMonitor/updateJobParams',
              method: 'POST',
              data: {
                appCode: _this.baseFormData.appCode,
                cycleNo: _this.baseFormData.cycleNo,
                groupCode: _this.baseFormData.groupCode,
                actionCode: _this.baseFormData.actionCode,
                actionPrior: _this.baseFormData.actionPrior,
                actionExec: _this.baseFormData.actionExec,
                actionLoc: _this.baseFormData.actionLoc,
                agentCode: _this.baseFormData.agentCode,
                coreId: _this.baseFormData.coreId
              },
              callback: function (code, message, response) {
                if (response && response.code == 0) {
                  _this.$message(response.message);
                  _this.visible = false;
                  _this.loading = false;
                } else {
                  _this.$message({
                    message: response.message,
                    type: 'warning', duration: 6000
                  });
                  _this.loading = false;
                }
              }
            });
          } else {
            _this.$message({
              message: '优先级请输入0到9之间的整数',
              type: 'warning', duration: 6000
            });
          }
        },
        // 重跑
        redoRunTask: function (id) {
          var _this = this;
          var selectionsAry = _this.$refs.refTable.selections;
          if (selectionsAry.length < 1) {
            _this.$message({
              message: '请先选择记录',
              type: 'warning', duration: 6000
            });
            return;
          }
          var flag = true;
          for (var i = 0; i < selectionsAry.length; i++) {
            if (selectionsAry[i].jobState != 'F' && selectionsAry[i].jobState != 'U') {
              flag = false;
            }
          }
          if (flag) {
            var url = "api/use/monitor/taskMonitor/redoRunTask";
            _this.showDialog = true;
            _this.loadData = [];
            _this.loadDataCount = 0;
            for (var i = 0; i < selectionsAry.length; i++) {
              var data = {
                appCode: selectionsAry[i].appCode,
                cycleNo: selectionsAry[i].cycleNo,
                actionCode: selectionsAry[i].actionCode,
                sequence: selectionsAry[i].sequence
              }
              _this.commonRunTask(data, url, selectionsAry[i]);
            }
          } else {
            _this.$message({
              message: '存在无法重跑作业,请重新选择',
              type: 'warning', duration: 6000
            });
            return
          }
        },
        reloadData: function () {
          var _this = this;
          var paramObject = {};
          if (_this.$refs.queryJobRef.fm.actionName !== '') {
            paramObject.actionName = _this.$refs.queryJobRef.fm.actionName;
          }
          if (_this.$refs.queryJobRef.fm.jobState !== '') {
            paramObject.jobState = _this.$refs.queryJobRef.fm.jobState;
          }
          paramObject.coreId = data.coreId;
          if (data.isHistory) {
            _this.$refs.refTable.dataUrl = 'api/use/monitor/taskMonitorHis/queryJobList';
            paramObject.coreId = data.wftId;
          }
          paramObject.cycleNo = data.cycleNo;
          var param = {
            condition: JSON.stringify(paramObject)
          };
          _this.$refs.refTable.remoteData(param);
        },
        //中断
        interruptFlowChart: function (row) {
          var _this = this;
          var selectionsAry = _this.$refs.refTable.selections;
          if (selectionsAry.length < 1) {
            _this.$message({
              message: '请先选择记录',
              type: 'warning', duration: 6000
            });
            return;
          }
          var flag = true;
          for (var i = 0; i < selectionsAry.length; i++) {
            if (selectionsAry[i].jobState != 'X') {
              flag = false;
            }
          }
          if (flag) {
            var url = "api/use/monitor/taskMonitor/interruptTask";
            _this.showDialog = true;
            _this.loadData = [];
            _this.loadDataCount = 0;
            for (var i = 0; i < selectionsAry.length; i++) {
              var data = {
                appCode: selectionsAry[i].appCode,
                cycleNo: selectionsAry[i].cycleNo,
                sequence: selectionsAry[i].sequence
              }
              _this.commonRunTask(data, url, selectionsAry[i]);
            }
          } else {
            _this.$message({
              message: '存在无法中断作业,请重新选择',
              type: 'warning', duration: 6000
            });
            return
          }
        },
        commonRunTask: function (row, url, rowData) {
          var _this = this;
          var loadDataColumn = {
            appName: rowData.appName,
            groupName: rowData.groupName,
            actionName: rowData.actionName,
            cyclePnt: rowData.cyclePnt,
            runState: '处理中'
          };
          _this.loadData.push(loadDataColumn);
          yufp.service.request({
            method: 'GET',
            url: url,
            data: row,
            timeout: 600000,
            callback: function (code, message, response) {
              if (response.code != 0) {
                loadDataColumn.runState = "失败";
                if (_this.showDialog) {
                  _this.setLoadDataState(loadDataColumn);
                }
              } else {
                loadDataColumn.runState = "成功";
                if (_this.showDialog) {
                  _this.setLoadDataState(loadDataColumn);
                }
                //_this.reloadData();
              }
            }
          });
        },
        //强制成功
        forceJobSuccess: function () {
          var _this = this;
          var selectionsAry = _this.$refs.refTable.selections;
          if (selectionsAry.length < 1) {
            _this.$message({
              message: '请先选择记录',
              type: 'warning', duration: 6000
            });
            return;
          }
          var flag = true;
          for (var i = 0; i < selectionsAry.length; i++) {
            if (selectionsAry[i].jobState != 'F' && selectionsAry[i].jobState != 'U') {
              flag = false;
            }
          }
          if (flag) {
            var url = "api/use/monitor/taskMonitor/forceJobSuccess";
            _this.showDialog = true;
            _this.loadData = [];
            _this.loadDataCount = 0;
            for (var i = 0; i < selectionsAry.length; i++) {
              var data = {
                appCode: selectionsAry[i].appCode,
                cycleNo: selectionsAry[i].cycleNo,
                sequence: selectionsAry[i].sequence,
                retValue: '0'
              }
              _this.commonRunTask(data, url, selectionsAry[i]);
            }
          } else {
            _this.$message({
              message: '存在无法强制作业,请重新选择',
              type: 'warning', duration: 6000
            });
            return
          }
        },
        //查看作业流流程图
        showFlowChart: function () {
          var _this = this;
          var selections = _this.$refs.refTable.selections;
          if (selections.length != 1) {
            _this.$message({
              message: '请选择单个作业流',
              type: 'warning', duration: 6000
            });
            return
          }
          var row = data;
          var chartUrl = row.isHistory ? 'api/use/monitor/taskMonitorHis/queryFlowChart' :
            'api/use/monitor/taskMonitor/queryFlowChart';
          yufp.service.request({
            url: chartUrl,
            method: 'get',
            data: {
              coreId: row.isHistory ? row.wftId : row.coreId,
              cycleNo: row.cycleNo,
              groupCode: row.groupCode,
              appCode: row.appCode
            },
            callback: function (code, message, response) {
              if (!response.data) {
                _this.$message({
                  message: '流程图数据为空！',
                  type: 'warning', duration: 6000
                });
                return;
              } else {
                var customKey = 'custom_' + new Date().getTime();
                var routeId = 'router_' + new Date().getTime();
                var url = 'pages/use/monitors/taskMonitor/taskMonitorGraph/taskMonitorGraph';
                yufp.router.addRoute(routeId, {
                  html: url + '.html',
                  js: url + '.js'
                });
                row.customKey = customKey;
				// row.runFnButton = true;
				// row.isHistory = false;
                yufp.frame.addTab({
                  id: routeId, // 菜单功能ID（路由ID）
                  key: customKey, // 自定义唯一页签key,请统一使用custom_前缀开头
                  // title: row.appName + '_流程图', // 页签名称
                  title: row.isHistory ? row.taskName + '_流程图' : row.groupName + '_流程图', // 页签名称
                  data: yufp.clone({ routeId: routeId }, row) // 传递的业务数据，可选配置
                });
              }
            }
          });
        },
        /**
         * 加载集群代理名称
         */
        queryWftAgtList: function () {
          var _this = this;
          var paramObj = {};
          paramObj.appCode = data.appCode;
          yufp.service.request({
            method: 'GET',
            url: backend.useService + "/plats/apps/queryWftAgtList",
            data: paramObj,
            async: false,
            callback: function (code, message, response) {
              if (response.code != 0) {
                isOk = false;
                _this.$message(response.message);
              } else {
                _this.agentIds.splice(0);
                _this.agentIds.push({
                  key: " ",
                  value: "虚拟代理"
                });
                for (let i = 0; i < response.data.length; i++) {
                  _this.agentIds.push({
                    key: response.data[i].agentCode,
                    value: response.data[i].agentName
                  });
                }
              }
            }
          });
        },
        cellClick: function (row, event, column, index) {
          var _this = this;
          if (row) {
            _this.$refs.refTable.toggleRowSelection(row);
          }
        },
        // 打开预置返回值页面
        preValue: function () {
          var _this = this;
          var selectionsAry = _this.$refs.refTable.selections;
          if (selectionsAry.length < 1) {
            _this.$message({
              message: '请先选择记录',
              type: 'warning', duration: 6000
            });
            return;
          }
          var flag = true;
          for (var i = 0; i < selectionsAry.length; i++) {
            if (selectionsAry[i].jobState != 'W' && selectionsAry[i].jobState != 'Q' && selectionsAry[i].jobState != 'N') {
              flag = false;
            }
          }
          if (flag) {
            yufp.service.request({
              method: 'GET',
              url: "api/use/monitor/taskMonitor/showPreValue",
              data: {
                coreId: selectionsAry[0].coreId,
                appCode: selectionsAry[0].appCode,
                cycleNo: selectionsAry[0].cycleNo,
                groupCode: selectionsAry[0].groupCode,
                actionCode: selectionsAry[0].actionCode
              },
              async: false,
              callback: function (code, message, response) {
                _this.preValueDialogVisible = true;
                _this.$nextTick(function () {
                  _this.$refs.preValueForm.resetFields();
                  if (response && response.data) {
                    _this.preValueFormdata.returnValue = response.data;
                  }
                });
              }
            });
          } else {
            _this.$message({
              message: '存在无法预置返回值作业,请重新选择',
              type: 'warning', duration: 6000
            });
            return
          }
        },
        // 设置预置返回值
        setPreValue: function () {
          var _this = this;
          if (_this.preValueFormdata.returnValue >= 0 && _this.preValueFormdata.returnValue <= 255 && _this.preValueFormdata.returnValue % 1 === 0) {
            var selectionsAry = _this.$refs.refTable.selections;
            var url = "api/use/monitor/taskMonitor/setPreValue";
            _this.showDialog = true;
            _this.loadData = [];
            _this.loadDataCount = 0;
            for (var i = 0; i < selectionsAry.length; i++) {
              var data = {
                appCode: selectionsAry[i].appCode,
                cycleNo: selectionsAry[i].cycleNo,
                groupCode: selectionsAry[i].groupCode,
                actionCode: selectionsAry[i].actionCode,
                retValue: _this.preValueFormdata.returnValue
              }
              _this.commonRunTask(data, url, selectionsAry[i]);
            }
          } else {
            _this.$message({
              message: '请输入0到255之间的整数',
              type: 'warning', duration: 6000
            });
          }
        },
        // 打开强制设置返回值页面
        forceJobValue: function () {
          var _this = this;
          var selectionsAry = _this.$refs.refTable.selections;
          if (selectionsAry.length < 1) {
            _this.$message({
              message: '请先选择记录',
              type: 'warning', duration: 6000
            });
            return;
          }
          var flag = true;
          for (var i = 0; i < selectionsAry.length; i++) {
            if (selectionsAry[i].jobState != 'U') {
              flag = false;
            }
          }
          if (flag) {
            _this.showModifyRetValue = true;
            _this.$nextTick(function () {
              _this.$refs.modifyRetForm.resetFields();
            });
          } else {
            _this.$message({
              message: '只有处于未知点作业可强制设置返回值,请重新选择',
              type: 'warning', duration: 6000
            });
            return
          }
        },
        // 强制设置返回值
        setModifyRetValuee: function () {
          var _this = this;
          var selectionsAry = _this.$refs.refTable.selections;
          if (_this.modifyRetValue.returnValue >= 0 && _this.modifyRetValue.returnValue <= 255 && _this.modifyRetValue.returnValue % 1 === 0) {
            var url = "api/use/monitor/taskMonitor/forceJobSuccess";
            _this.showDialog = true;
            _this.loadData = [];
            _this.loadDataCount = 0;
            for (var i = 0; i < selectionsAry.length; i++) {
              var data = {
                appCode: selectionsAry[i].appCode,
                cycleNo: selectionsAry[i].cycleNo,
                sequence: selectionsAry[i].sequence,
                retValue: _this.modifyRetValue.returnValue
              }
              _this.commonRunTask(data, url, selectionsAry[i]);
            }
          } else {
            _this.$message({
              message: '请输入0到255之间的整数',
              type: 'warning', duration: 6000
            });
          }
        },
        // 取消预置返回值
        unPreValue: function () {
          var _this = this;
          var selectionsAry = _this.$refs.refTable.selections;
          if (selectionsAry.length < 1) {
            _this.$message({
              message: '请先选择记录',
              type: 'warning', duration: 6000
            });
            return;
          }
          var flag = true;
          for (var i = 0; i < selectionsAry.length; i++) {
            if (selectionsAry[i].jobState != 'W' && selectionsAry[i].jobState != 'Q' && selectionsAry[i].jobState !=
              'N') {
              flag = false;
            }
          }
          if (flag) {
            var url = "api/use/monitor/taskMonitor/unsetPreValue";
            _this.showDialog = true;
            _this.loadData = [];
            _this.loadDataCount = 0;
            for (var i = 0; i < selectionsAry.length; i++) {
              var data = {
                appCode: selectionsAry[i].appCode,
                cycleNo: selectionsAry[i].cycleNo,
                groupCode: selectionsAry[i].groupCode,
                actionCode: selectionsAry[i].actionCode,
              }
              _this.commonRunTask(data, url, selectionsAry[i]);
            }
          } else {
            _this.$message({
              message: '存在无法取消预设返回值作业,请重新选择',
              type: 'warning', duration: 6000
            });
            return
          }
        },
        // 构造进程数据
        setLoadDataState: function (loadDataColumn) {
          var _this = this;
          _this.loadDataCount++;
          for (var i = 0; i < _this.loadData.length; i++) {
            if (_this.loadData[i].appName == loadDataColumn.appName && _this.loadData[i].groupName ==
              loadDataColumn.groupName &&
              _this.loadData[i].actionName == loadDataColumn.actionName && _this.loadData[i].cyclePnt ==
              loadDataColumn.cyclePnt
            ) {
              _this.loadData[i].runState = loadDataColumn.runState;
            }
          }
        },
        // 关闭dialog
        closeDialog: function () {
          var _this = this;
          _this.showDialog = false;
          _this.preValueDialogVisible = false;
          _this.showModifyRetValue = false;
          _this.showJobPriorValue = false;
          _this.reloadData();
        },
        // 优先级调整
        jobPriorClick: function () {
          var _this = this;
          var selectionsAry = _this.$refs.refTable.selections;
          if (selectionsAry.length < 1) {
            _this.$message({
              message: '请先选择记录',
              type: 'warning', duration: 6000
            });
            return;
          }
          _this.showJobPriorValue = true;
        },
        // 优先级调整保存
        setJobPriorValue: function () {
          var _this = this;
          if (_this.jobPriorValue.jobPrior >= 0 && _this.jobPriorValue.jobPrior <= 9 && _this.jobPriorValue
            .jobPrior %
            1 === 0) {
            var selectionsAry = _this.$refs.refTable.selections;
            var url = "api/use/monitor/taskMonitor/updatePriorValue";
            _this.showDialog = true;
            _this.loadData = [];
            _this.loadDataCount = 0;
            for (var i = 0; i < selectionsAry.length; i++) {
              var data = {
                appCode: selectionsAry[i].appCode,
                cycleNo: selectionsAry[i].cycleNo,
                groupCode: selectionsAry[i].groupCode,
                actionCode: selectionsAry[i].actionCode,
                actionPrior: _this.jobPriorValue.jobPrior
              }
              _this.commonRunTask(data, url, selectionsAry[i]);
            }
          } else {
            _this.$message({
              message: '请输入0到9之间的整数',
              type: 'warning', duration: 6000
            });
          }
        },
        /**
				 * 排序
				*/
				sort: function (column) {
					var _this = this;
					// _this.queryJobRef.sortColunm = _this.sortColunms[column.prop];
          // _this.queryJobRef.sorType = _this.sortTypes[column.order];
          var model=_this.$refs.queryJobRef.fm;
          var param = {
            condition: {
              sortColunm:_this.sortColunms[column.prop],
              sorType :_this.sortTypes[column.order],
              coreId: data.isHistory ? data.wftId : data.coreId,
              cycleNo: data.cycleNo,
              actionName: model.actionName,
              actionCode: model.actionCode,
              jobState: (model.jobState && model.jobState != '') ? model.jobState : null
            }
          };
					// var param = { condition: JSON.stringify(_this.queryJobRef) };
					_this.$refs.refTable.remoteData(param);
				}
      }
    });
  };

  // 消息处理
  exports.onmessage = function (type, message) {

  };
});
